home *** CD-ROM | disk | FTP | other *** search
/ Sprite 1984 - 1993 / Sprite 1984 - 1993.iso / src / X11R4 / cmds / X / ddx / Xmfbpmax / machine / pmevent.h < prev    next >
Encoding:
C/C++ Source or Header  |  1990-04-24  |  2.9 KB  |  99 lines

  1. /* @(#)pmevent.h    "%W"    (ULTRIX)    9/6/88";
  2. /************************************************************************
  3. *                                    *
  4. *            Copyright (c) 1985 by                *
  5. *        Digital Equipment Corporation, Maynard, MA        *
  6. *            All rights reserved.                *
  7. *                                    *
  8. *   This software is furnished under a license and may be used and    *
  9. *   copied  only  in accordance with the terms of such license and    *
  10. *   with the  inclusion  of  the  above  copyright  notice.   This    *
  11. *   software  or  any  other copies thereof may not be provided or    *
  12. *   otherwise made available to any other person.  No title to and    *
  13. *   ownership of the software is hereby transferred.            *
  14. *                                    *
  15. *   The information in this software is subject to change  without    *
  16. *   notice  and should not be construed as a commitment by Digital    *
  17. *   Equipment Corporation.                        *
  18. *                                    *
  19. *   Digital assumes no responsibility for the use  or  reliability    *
  20. *   of its software on equipment which is not supplied by Digital.    *
  21. *                                    *
  22. ************************************************************************/
  23.  
  24. /*
  25.  * Event queue entries
  26.  */
  27.  
  28. # ifndef _PMEVENT_
  29. # define _PMEVENT_
  30.  
  31. typedef struct  _event {
  32.         short            x;        /* x position */
  33.         short             y;        /* y position */
  34.         unsigned int    time;        /* 1 millisecond units */
  35.         unsigned char   type;        /* button up/down/raw or motion */
  36.         unsigned char   key;        /* the key (button only) */
  37.         unsigned char   index;        /* which instance of device */
  38.         unsigned char   device;        /* which device */
  39. } pmEvent;
  40.  
  41. /* type field */
  42. #define BUTTON_UP_TYPE          0
  43. #define BUTTON_DOWN_TYPE        1
  44. #define BUTTON_RAW_TYPE         2
  45. #define MOTION_TYPE             3
  46.  
  47. /* device field */
  48. #define NULL_DEVICE      0        /* NULL event (for QD_GETEVENT ret) */
  49. #define MOUSE_DEVICE      1        /* mouse */
  50. #define KEYBOARD_DEVICE      2        /* main keyboard */
  51. #define TABLET_DEVICE      3        /* graphics tablet */
  52. #define AUX_DEVICE      4        /* auxiliary */
  53. #define CONSOLE_DEVICE      5        /* console */
  54. #define KNOB_DEVICE      8
  55. #define JOYSTICK_DEVICE      9
  56.  
  57. #define PMMAXEVQ    64    /* must be power of 2 */
  58. #define EVROUND(x)    ((x) & (PMMAXEVQ - 1))
  59. #define TABLET_RES    2
  60.  
  61. typedef struct _timecoord {
  62.     unsigned int    time;
  63.     short        x, y;
  64. } pmTimeCoord;
  65.  
  66. /*
  67.  * The event queue. This structure is normally included in the info
  68.  * returned by the device driver.
  69.  */
  70.  
  71. typedef struct _eventqueue {
  72.     pmEvent     *events;
  73.     unsigned int     eSize;
  74.         unsigned int    eHead;
  75.         unsigned int    eTail;
  76.     unsigned    long    timestamp_ms;
  77.     pmTimeCoord    *tcs;    /* history of pointer motions */
  78.     unsigned int    tcSize;
  79.     unsigned int    tcNext;    /* simple ring buffer, old events are tossed */
  80. } pmEventQueue;
  81.  
  82. /* mouse cursor position */
  83.  
  84. typedef struct _cursor {
  85.         short x;
  86.         short y;
  87. } pmCursor;
  88.  
  89. /* mouse motion rectangle */
  90.  
  91. typedef struct _box {
  92.         short bottom;
  93.         short right;
  94.         short left;
  95.         short top;
  96. } pmBox;
  97.  
  98. # endif _PMEVENT_
  99.